﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.BLL;
using Automobile.service.Model;
namespace Automobile.service.UI.Hander
{
    /// <summary>
    /// XiaoshouTongji 的摘要说明
    /// </summary>
    public class XiaoshouTongji : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            XiaoShowBLL bll = new XiaoShowBLL();
            string url = context.Request["url"];
            switch (url)
            {
                case "a":
                    string fitstyear = context.Request["firstyear"];
                    string lastyear = context.Request["lastyear"];
                    context.Response.Write(bll.CaigouByyear(fitstyear, lastyear));
                    break;
                case "b":
                    string firstyear = context.Request["firstyear"];
                    string firstmonth = context.Request["firstmonth"];
                    string lastmonth = context.Request["lastmonth"];
                    string str = bll.CaigouByMonth(firstyear, firstmonth, lastmonth);
                    context.Response.Write(str);
                    break;
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}